package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.dto.HomePageReportDTO;
import com.ruoyi.system.domain.vo.HomePageReportVo;
import com.ruoyi.system.service.IHomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/home")
@Anonymous
public class HomePageController extends BaseController {

    @Autowired
    private IHomePageService homePageService;

    @RequestMapping("/index")
    public AjaxResult getInfo() {
        return success(homePageService.getHomePageIndex());
    }

    @RequestMapping("/report")
    public AjaxResult getReport(@RequestBody HomePageReportDTO reportDTO) {
        List<HomePageReportVo> list = homePageService.getHomePageReport(reportDTO);
        return success(list);
    }
}
